package com.lanlian.cayman.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.lanlian.commonlib.bean.UtilEnumInfo;
import com.lanlian.cayman.R;

import java.util.ArrayList;

/**
 * <pre>
 *     author : huxiaobo
 *     e-mail : huxiaobo@xlanlian.com
 *     date   : 2018/8/30 20:29
 *     desc   : todo
 *     version: 1.0
 * </pre>
 */
public class SpinnerFundTypeAdapter extends BaseAdapter {

    private ArrayList<UtilEnumInfo> mList;
    private Context mContext;

    public SpinnerFundTypeAdapter(ArrayList<UtilEnumInfo> mList, Context mContext) {
        this.mList = mList;
        this.mContext = mContext;
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.adapter_spinner_utilenum, null);
        }
        TextView mTvType = convertView.findViewById(R.id.tv_util_enum);
        mTvType.setText(mList.get(position).getName());
        return convertView;
    }
}
